home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 November
/
CMCD1104.ISO
/
Software
/
Freeware
/
Grafica
/
galeroo
/
Setup Galleroo 3.4.exe
/
{app}
/
styles
/
Lib
/
galleroo.xsl
Wrap
Extensible Markup Language
|
2004-09-20
|
37KB
|
817 lines
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
xmlns:func="http://exslt.org/functions"
xmlns:galleroo="."
extension-element-prefixes="func galleroo exsl"
version='1.1'>
<!-- Galleroo stylesheet library 1.5
Copyright 2003-2004, all rights reserved, xyster.net
written:
modified:
author: xyster
-->
<!-- need this guy so we can access general lister info outside of
the scope of queries we will be called on
-->
<xsl:variable name="source-root" select="/" />
<!-- sort images using the attribute named in sort-by -->
<func:function name="galleroo:sort-pix">
<xsl:param name="pix" />
<xsl:param name="sort-by" />
<xsl:variable name="sorted-pix">
<xsl:for-each select="$pix">
<xsl:sort select="attrib/*[name()=$sort-by]" />
<xsl:copy-of select="." />
</xsl:for-each>
</xsl:variable>
<func:result select="$sorted-pix" />
</func:function>
<!-- function to trim everything after a period (.). Makes for pretty filenames -->
<func:function name="galleroo:pretty-name">
<xsl:param name="name" />
<func:result select="concat(substring($name, 1, string-length($name) - 6),
substring-before(substring($name, string-length($name) - 5, 5), '.'))" />
</func:function>
<func:function name="galleroo:index-html-name">
<xsl:param name="index" />
<xsl:choose>
<xsl:when test="$index = 1">
<func:result>index.html</func:result>
</xsl:when>
<xsl:otherwise>
<func:result>index<xsl:value-of select="$index" />.html</func:result>
</xsl:otherwise>
</xsl:choose>
</func:function>
<func:function name="galleroo:image-title">
<xsl:param name="attrib" />
<xsl:choose>
<xsl:when test="$attrib/user-title != ''">
<func:result select="$attrib/user-title" />
</xsl:when>
<xsl:when test="galleroo:iptc($attrib, 'title') != ''">
<func:result select="galleroo:iptc($attrib, 'title')" />
</xsl:when>
<xsl:otherwise>
<func:result select="galleroo:pretty-name($attrib/name)" />
</xsl:otherwise>
</xsl:choose>
</func:function>
<func:function name="galleroo:image-caption">
<xsl:param name="attrib" />
<xsl:choose>
<xsl:when test="$attrib/user-caption != ''">
<func:result> - <xsl:value-of select="$attrib/user-caption" /></func:result>
</xsl:when>
<xsl:when test="galleroo:iptc($attrib, 'caption') != ''">
<func:result> - <xsl:value-of select="galleroo:iptc($attrib, 'caption')" /></func:result>
</xsl:when>
<xsl:otherwise>
<func:result select="''" />
</xsl:otherwise>
</xsl:choose>
</func:function>
<func:function name="galleroo:image-comment">
<xsl:param name="attrib" />
<xsl:choose>
<xsl:when test="$attrib/user-comment != ''">
<func:result select="$attrib/user-comment" />
</xsl:when>
<xsl:when test="galleroo:iptc($attrib, 'comment') != ''">
<func:result select="galleroo:iptc($attrib, 'comment')" />
</xsl:when>
<xsl:otherwise>
<func:result select="$attrib/comment" />
</xsl:otherwise>
</xsl:choose>
</func:function>
<!-- gets the next image in the list -->
<func:function name="galleroo:next-image">
<func:result select="following-sibling::object[position() = 1]" />
</func:function>
<!-- gets the previous image in the list -->
<func:function name="galleroo:previous-image">
<func:result select="preceding-sibling::object[position() = 1]" />
</func:function>
<func:function name="galleroo:iptc-num">
<xsl:param name="iname" />
<xsl:variable name="xtab">
<a><name>unknown0</name><num>00</num></a>
<a><name>title</name><num>05</num></a>
<a><name>urgency</name><num>0a</num></a>
<a><name>categories</name><num>14</num></a>
<a><name>keywords</name><num>19</num></a>
<a><name>instructions</name><num>28</num></a>
<a><name>date</name><num>37</num></a>
<a><name>author</name><num>50</num></a>
<a><name>author-position</name><num>55</num></a>
<a><name>city</name><num>5a</num></a>
<a><name>state</name><num>5f</num></a>
<a><name>country-code</name><num>64</num></a>
<a><name>country</name><num>65</num></a>
<a><name>trans-ref</name><num>67</num></a>
<a><name>headline</name><num>69</num></a>
<a><name>credit</name><num>6e</num></a>
<a><name>source</name><num>73</num></a>
<a><name>copyright</name><num>74</num></a>
<a><name>caption</name><num>78</num></a>
<a><name>caption-author</name><num>7a</num></a>
</xsl:variable>
<xsl:choose>
<xsl:when test="substring($iname, 1, 5) = 'iptc-'">
<xsl:variable name="jname" select="substring-after($iname, 'iptc-')" />
<func:result select="concat('iptc-', exsl:node-set($xtab)/a[name = $jname]/num)" />
</xsl:when>
<xsl:otherwise>
<func:result select="concat('iptc-', exsl:node-set($xtab)/a[name = $iname]/num)" />
</xsl:otherwise>
</xsl:choose>
</func:function>
<func:function name="galleroo:iptc">
<xsl:param name="attrib" />
<xsl:param name="name" />
<func:result select="$attrib/*[name() = galleroo:iptc-num($name)]" />
</func:function>
<func:function name="galleroo:rplstr">
<xsl:param name="value" />
<xsl:param name="from" />
<xsl:param name="to" />
<func:result><xsl:call-template name="gal-rplstr"><xsl:with-param name="value" select="$value" /><xsl:with-param name="from" select="$from" /><xsl:with-param name="to" select="$to" /></xsl:call-template></func:result>
</func:function>
<xsl:template name="gal-emit-css-file">
<xsl:param name="name" />
<xsl:param name="html-file-prefix" />
<xsl:param name="background-image" />
<xsl:param name="background-color" />
<xsl:param name="font" />
<xsl:param name="text-color" />
<xsl:param name="link-color" />
<xsl:param name="active-link-color" />
<xsl:param name="visited-link-color" />
<!-- leave room for post creation, user customization -->
@import url("base.css");
body
{
<xsl:call-template name="gal-emit-css-attribute">
<xsl:with-param name="name" select="'background-image'" />
<xsl:with-param name="value" select="$background-image" />
<xsl:with-param name="type" select="'url'" />
</xsl:call-template>
<xsl:call-template name="gal-emit-css-attribute">
<xsl:with-param name="name" select="'background-color'" />
<xsl:with-param name="value" select="$background-color" />
</xsl:call-template>
<xsl:call-template name="gal-emit-css-attribute">
<xsl:with-param name="name" select="'color'" />
<xsl:with-param name="value" select="$text-color" />
</xsl:call-template>
<xsl:call-template name="gal-emit-css-font-attributes">
<xsl:with-param name="font" select="$font" />
</xsl:call-template>
}
a
{
<xsl:call-template name="gal-emit-css-attribute">
<xsl:with-param name="name" select="'color'" />
<xsl:with-param name="value" select="$link-color" />
</xsl:call-template>
}
a:visited
{
<xsl:call-template name="gal-emit-css-attribute">
<xsl:with-param name="name" select="'color'" />
<xsl:with-param name="value" select="$visited-link-color" />
</xsl:call-template>
}
a:active
{
<xsl:call-template name="gal-emit-css-attribute">
<xsl:with-param name="name" select="'color'" />
<xsl:with-param name="value" select="$active-link-color" />
</xsl:call-template>
}
a:hover
{
<xsl:call-template name="gal-emit-css-attribute">
<xsl:with-param name="name" select="'color'" />
<xsl:with-param name="value" select="$active-link-color" />
</xsl:call-template>
}
<!-- cutter output -->
<xsl:text> </xsl:text>
<xsl:comment>CUTHERE: <xsl:value-of select="galleroo:rplstr(concat($html-file-prefix, $name), '-', '\-')" />.css ?</xsl:comment>
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template name="gal-emit-css-attribute">
<xsl:param name="name" />
<xsl:param name="value" />
<xsl:param name="type" />
<xsl:if test="string-length($value) != 0">
<xsl:choose>
<xsl:when test="$type = 'url'">
<xsl:value-of select="$name" />: url(<xsl:value-of select="$value" />);
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$name" />: <xsl:value-of select="$value" />;
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<!-- line-through underline italic bold 14pt "Comic Sans MS", fantasy -->
<xsl:template name="gal-emit-css-font-attributes">
<xsl:param name="font" />
<xsl:if test="string-length($font) != 0">
<xsl:variable name="first-attribute" select="substring-before($font, ' ')" />
<xsl:variable name="second-attribute" select="substring-before(substring-after($font, concat($first-attribute, ' ')), ' ')" />
<xsl:choose>
<xsl:when test="$first-attribute = 'underline'">
<xsl:call-template name="gal-emit-css-attribute">
<xsl:with-param name="name" select="'text-decoration'" />
<xsl:with-param name="value" select="$first-attribute" />
</xsl:call-template>
<xsl:call-template name="gal-emit-css-attribute">
<xsl:with-param name="name" select="'font'" />
<xsl:with-param name="value" select="substring-after($font, $first-attribute)" />
</xsl:call-template>
</xsl:when>
<xsl:when test="$first-attribute = 'line-through'">
<xsl:choose>
<xsl:when test="$second-attribute = 'underline'">
<xsl:call-template name="gal-emit-css-attribute">
<xsl:with-param name="name" select="'text-decoration'" />
<xsl:with-param name="value" select="concat($first-attribute, ' ', $second-attribute)" />
</xsl:call-template>
<xsl:call-template name="gal-emit-css-attribute">
<xsl:with-param name="name" select="'font'" />
<xsl:with-param name="value" select="substring-after($font, $second-attribute)" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gal-emit-css-attribute">
<xsl:with-param name="name" select="'text-decoration'" />
<xsl:with-param name="value" select="$first-attribute" />
</xsl:call-template>
<xsl:call-template name="gal-emit-css-attribute">
<xsl:with-param name="name" select="'font'" />
<xsl:with-param name="value" select="substring-after($font, $first-attribute)" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="gal-emit-css-attribute">
<xsl:with-param name="name" select="'font'" />
<xsl:with-param name="value" select="$font" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<!-- Emit simple navbar/slide based frameset
-->
<xsl:template name="gal-emit-frameset">
<xsl:param name="preview" />
<xsl:param name="title" />
<xsl:param name="sub-title" />
<xsl:param name="nav-alignment" />
<xsl:param name="sort-by" />
<xsl:param name="thumb-size" />
<xsl:param name="padding" />
<xsl:param name="html-file-prefix" />
<!-- frameset -->
<html>
<head>
<title><xsl:value-of select="$title" /> - <xsl:value-of select="$sub-title" /></title>
</head>
<xsl:choose>
<xsl:when test="$nav-alignment = 'left'">
<frameset cols="{$thumb-size + $padding},*" frameborder="yes" border="0" framespacing="0">
<frame name="navFrame" scrolling="yes" noresize="1" src="{$html-file-prefix}nav.html" />
<xsl:call-template name="gal-emit-initial-slide-frame">
<xsl:with-param name="preview" select="$preview" />
<xsl:with-param name="sort-by" select="$sort-by" />
<xsl:with-param name="html-file-prefix" select="$html-file-prefix" />
</xsl:call-template>
</frameset>
</xsl:when>
<xsl:when test="$nav-alignment = 'top'">
<frameset rows="{$thumb-size + $padding},*" frameborder="yes" border="0" framespacing="0">
<frame name="navFrame" scrolling="yes" noresize="1" src="{$html-file-prefix}nav.html" />
<xsl:call-template name="gal-emit-initial-slide-frame">
<xsl:with-param name="preview" select="$preview" />
<xsl:with-param name="sort-by" select="$sort-by" />
<xsl:with-param name="html-file-prefix" select="$html-file-prefix" />
</xsl:call-template>
</frameset>
</xsl:when>
<xsl:when test="$nav-alignment = 'right'">
<frameset cols="*, {$thumb-size + $padding}" frameborder="yes" border="0" framespacing="0">
<xsl:call-template name="gal-emit-initial-slide-frame">
<xsl:with-param name="preview" select="$preview" />
<xsl:with-param name="sort-by" select="$sort-by" />
<xsl:with-param name="html-file-prefix" select="$html-file-prefix" />
</xsl:call-template>
<frame name="navFrame" scrolling="yes" noresize="1" src="{$html-file-prefix}nav.html" />
</frameset>
</xsl:when>
<xsl:when test="$nav-alignment = 'bottom'">
<frameset rows="*, {$thumb-size + $padding}" frameborder="yes" border="0" framespacing="0">
<xsl:call-template name="gal-emit-initial-slide-frame">
<xsl:with-param name="preview" select="$preview" />
<xsl:with-param name="sort-by" select="$sort-by" />
<xsl:with-param name="html-file-prefix" select="$html-file-prefix" />
</xsl:call-template>
<frame name="navFrame" scrolling="yes" noresize="1" src="{$html-file-prefix}nav.html" />
</frameset>
</xsl:when>
</xsl:choose>
<noframes>
<body class="noframe-page">
You need a web browser that supports frames to view this photo gallery.
</body>
</noframes>
</html>
<!-- cutter output -->
<xsl:call-template name="gal-emit-cutter-index">
<xsl:with-param name="index" select="1" />
<xsl:with-param name="html-file-prefix" select="$html-file-prefix" />
</xsl:call-template>
</xsl:template>
<xsl:template name="gal-emit-initial-slide-frame">
<xsl:param name="preview" />
<xsl:param name="sort-by" />
<xsl:param name="html-file-prefix" />
<xsl:choose>
<xsl:when test="$preview = 0">
<frame name="main" src="{$html-file-prefix}blank.html" />
</xsl:when>
<xsl:otherwise>
<xsl:variable name="sorted-pix" select="galleroo:sort-pix($source-root/list/media/object/children/object/children/object, $sort-by)" />
<frame name="main" src="{$html-file-prefix}{exsl:node-set($sorted-pix)/*[1]/attrib/name}.html" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Navigation Bar -->
<xsl:template name="gal-emit-nav-bar">
<xsl:param name="alignment" />
<xsl:param name="sort-by" />
<xsl:param name="css-name" />
<xsl:param name="custom-css-file" />
<xsl:param name="html-file-prefix" />
<html>
<head>
<link type="text/css" rel="stylesheet" href="{$html-file-prefix}{$css-name}.css" />
<xsl:if test="string-length($custom-css-file) != 0">
<link type="text/css" rel="stylesheet" href="{$custom-css-file}" />
</xsl:if>
<title>Galleroo Nav Bar</title>
</head>
<body class="index-page">
<xsl:choose>
<!-- vertical nav bar -->
<xsl:when test="$alignment = 'left' or $alignment = 'right'">
<!-- home link -->
<div align="center">
<a href="../index.html" target="_top">Home</a>
</div>
<div align="center">
<table class="thumb-table" align="center" border="0">
<xsl:for-each select="media/object/children/object/children/object">
<xsl:sort select="attrib/*[name()=$sort-by]" />
<tr>
<td align="center"><a target="main" href="{$html-file-prefix}{attrib/name}.html"><img class="thumb" width="{attrib/thumb-x-size}" height="{attrib/thumb-y-size}" src="{attrib/thumb-path}/{attrib/thumb-name}" border="0" /></a></td>
</tr>
<tr>
<td align="center"><a target="main" href="{$html-file-prefix}{attrib/name}.html"><xsl:value-of select="galleroo:image-title(attrib)" /></a></td>
</tr>
</xsl:for-each>
</table>
</div>
</xsl:when>
<!-- horizontal nav bar -->
<xsl:otherwise>
<!-- home link -->
<div align="left">
<a href="../index.html" target="_top">Home</a>
</div>
<!-- thumbnails -->
<div align="center">
<table class="thumb-table" align="center" border="0">
<tr>
<xsl:for-each select="media/object/children/object/children/object">
<xsl:sort select="attrib/*[name()=$sort-by]" />
<td align="center"><a target="main" href="{$html-file-prefix}{attrib/name}.html"><img class="thumb" width="{attrib/thumb-x-size}" height="{attrib/thumb-y-size}" src="{attrib/thumb-path}/{attrib/thumb-name}" border="0" /></a></td>
</xsl:for-each>
</tr>
<tr>
<xsl:for-each select="media/object/children/object/children/object">
<xsl:sort select="attrib/*[name()=$sort-by]" />
<td align="center"><a target="main" href="{$html-file-prefix}{attrib/name}.html"><xsl:value-of select="galleroo:image-title(attrib)" /></a></td>
</xsl:for-each>
</tr>
</table>
</div>
</xsl:otherwise>
</xsl:choose>
</body>
</html>
<!-- cutter output -->
<xsl:text> </xsl:text>
<xsl:comment>CUTHERE: <xsl:value-of select="galleroo:rplstr($html-file-prefix, '-', '\-')" />nav.html ?</xsl:comment>
<xsl:text> </xsl:text>
</xsl:template>
<!-- emit ye standard blank slide -->
<xsl:template name="gal-emit-blank-slide">
<xsl:param name="title" />
<xsl:param name="sub-title" />
<xsl:param name="css-name" />
<xsl:param name="custom-css-file" />
<xsl:param name="html-file-prefix" />
<html>
<head>
<link type="text/css" rel="stylesheet" href="{$html-file-prefix}{$css-name}.css" />
<xsl:if test="string-length($custom-css-file) != 0">
<link type="text/css" rel="stylesheet" href="{$custom-css-file}" />
</xsl:if>
<title><xsl:value-of select="$title" /> - <xsl:value-of select="$sub-title" /></title>
</head>
<body class="slide-page">
<!-- title -->
<div align="center"><h1><xsl:value-of select="$title" /> - <xsl:value-of select="$sub-title" /></h1></div>
</body>
</html>
<!-- cutter output -->
<xsl:text> </xsl:text>
<xsl:comment>CUTHERE: <xsl:value-of select="galleroo:rplstr($html-file-prefix, '-', '\-')" />blank.html ?</xsl:comment>
<xsl:text> </xsl:text>
</xsl:template>
<!-- emit ye simple slide pages -->
<xsl:template name="gal-emit-simple-slides">
<xsl:param name="pix" />
<xsl:param name="title" />
<xsl:param name="sub-title" />
<xsl:param name="css-name" />
<xsl:param name="custom-css-file" />
<xsl:param name="do-auto-play-movies" />
<xsl:param name="html-file-prefix" />
<xsl:for-each select="$pix">
<html>
<xsl:comment> Transformed from XML with Galleroo XSL stylesheet 1.0</xsl:comment>
<xsl:comment> Source path='<xsl:value-of select="$source-root/list/media/basepath" />' </xsl:comment>
<head>
<link type="text/css" rel="stylesheet" href="{$html-file-prefix}{$css-name}.css" />
<xsl:if test="string-length($custom-css-file) != 0">
<link type="text/css" rel="stylesheet" href="{$custom-css-file}" />
</xsl:if>
<title><xsl:value-of select="galleroo:image-title(attrib)" /><xsl:value-of select="galleroo:image-caption(attrib)" /></title>
</head>
<body class="slide-page">
<!-- title -->
<div align="center"><h1><xsl:value-of select="$title" /> - <xsl:value-of select="$sub-title" /></h1></div>
<!-- subtitle -->
<div align="center"><h3><xsl:value-of select="galleroo:image-title(attrib)" /><xsl:value-of select="galleroo:image-caption(attrib)" /></h3></div>
<!-- image -->
<xsl:call-template name="gal-emit-image">
<xsl:with-param name="do-auto-play-movies" select="$do-auto-play-movies" />
</xsl:call-template>
<!-- comment -->
<div style="text-align:center; margin-left:auto; margin-right:auto; align:center; width:50%; padding:1em;">
<xsl:value-of select="galleroo:image-comment(attrib)" />
</div>
<!-- lister signature -->
<xsl:call-template name="gal-emit-signature" />
</body>
</html>
<!-- cutter output -->
<xsl:text> </xsl:text>
<xsl:comment>CUTHERE: <xsl:value-of select="galleroo:rplstr(concat($html-file-prefix, attrib/name), '-', '\-')" />.html ?</xsl:comment>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:template>
<!-- simple, standard image/video output -->
<xsl:template name="gal-emit-image">
<xsl:param name="do-auto-play-movies" />
<!-- the full size image/video -->
<xsl:choose>
<!-- video -->
<xsl:when test="attrib/format = 'video'">
<div align="center">
<embed class="slide" src="{attrib/full-path}/{attrib/name}" mute="0" enablecontextmenu="1" showdisplay="0" autostart="{$do-auto-play-movies = 'yes'}" playcount="1" showcontrols="1" />
</div>
<div align="center">
<!--
commented out pretty number output until xsltproc is fixed.
<a href="{attrib/full-path}/{attrib/name}"><xsl:value-of select="galleroo:pretty-name(attrib/name)" /> (<xsl:number value="attrib/file-size div 1024" grouping-separator="," grouping-size="3" />KB)</a>
-->
<a href="{attrib/full-path}/{attrib/name}"><xsl:value-of select="galleroo:pretty-name(attrib/name)" /> (<xsl:number value="attrib/file-size" /> Bytes)</a>
</div>
</xsl:when>
<!-- image -->
<xsl:otherwise>
<div align="center">
<img class="slide" src="{attrib/full-path}/{attrib/name}" border="0" />
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- emit the wonderful Galleroo signature with a link back to www.xyster.net -->
<xsl:template name="gal-emit-signature">
<div>Generated by <a href="http://www.xyster.net"><xsl:value-of select="$source-root/list/generator" /></a></div>
</xsl:template>
<!-- In order to split the final HTML page, we emit file 'cutting' directives.
The directive format is "CUTHERE: <file name> ?". Note that there is exactly
one space before and after the file name and that because XML/XSL is braindead
we have to escape double dashes (what were they thinking!?).
-->
<!-- cutter index page output -->
<xsl:template name="gal-emit-cutter-index">
<xsl:param name="index" />
<xsl:param name="html-file-prefix" />
<xsl:text> </xsl:text>
<xsl:comment>CUTHERE: <xsl:value-of select="galleroo:rplstr(concat($html-file-prefix, galleroo:index-html-name($index)), '-', '\-')" /> ?</xsl:comment>
<xsl:text> </xsl:text>
</xsl:template>
<!-- cutter slide page output -->
<xsl:template name="gal-emit-cutter-slide">
<xsl:param name="html-file-prefix" />
<xsl:text> </xsl:text>
<xsl:comment>CUTHERE: <xsl:value-of select="galleroo:rplstr(concat($html-file-prefix, attrib/name), '-', '\-')" />.html ?</xsl:comment>
<xsl:text> </xsl:text>
</xsl:template>
<!-- creates a horizontal thumbnail slider. Must be in a table -->
<xsl:template name="gal-emit-horizontal-thumb-slider">
<xsl:param name="html-file-prefix" />
<xsl:param name="thumb-size" />
<xsl:param name="parent-index" />
<xsl:param name="index-last" />
<tr>
<td align="center" width="{$thumb-size}" height="{$thumb-size}">
<xsl:if test="position() > 2 or $parent-index != 1">
<a href="{$html-file-prefix}{preceding-sibling::object[position() = 2]/attrib/name}.html"><img class="thumb" width="{preceding-sibling::object[position() = 2]/attrib/thumb-x-size}" height="{preceding-sibling::object[position() = 2]/attrib/thumb-y-size}" src="{preceding-sibling::object[position() = 2]/attrib/thumb-path}/{preceding-sibling::object[position() = 2]/attrib/thumb-name}" border="0" /></a>
</xsl:if>
</td>
<td align="center" width="{$thumb-size}" height="{$thumb-size}">
<xsl:if test="position() > 1 or $parent-index != 1">
<a href="{$html-file-prefix}{preceding-sibling::object[position() = 1]/attrib/name}.html"><img class="thumb" width="{preceding-sibling::object[position() = 1]/attrib/thumb-x-size}" height="{preceding-sibling::object[position() = 1]/attrib/thumb-y-size}" src="{preceding-sibling::object[position() = 1]/attrib/thumb-path}/{preceding-sibling::object[position() = 1]/attrib/thumb-name}" border="0" /></a>
</xsl:if>
</td>
<td align="center" width="{$thumb-size}" height="{$thumb-size}">
<img class="thumb" width="{attrib/thumb-x-size}" height="{attrib/thumb-y-size}" src="{attrib/thumb-path}/{attrib/thumb-name}" border="0" />
</td>
<td align="center" width="{$thumb-size}" height="{$thumb-size}">
<xsl:if test="position() < last() or $parent-index != $index-last">
<a href="{$html-file-prefix}{following-sibling::object[position() = 1]/attrib/name}.html"><img class="thumb" width="{following-sibling::object[position() = 1]/attrib/thumb-x-size}" height="{following-sibling::object[position() = 1]/attrib/thumb-y-size}" src="{following-sibling::object[position() = 1]/attrib/thumb-path}/{following-sibling::object[position() = 1]/attrib/thumb-name}" border="0" /></a>
</xsl:if>
</td>
<td align="center" width="{$thumb-size}" height="{$thumb-size}">
<xsl:if test="position() < last() - 1 or $parent-index != $index-last">
<a href="{$html-file-prefix}{following-sibling::object[position() = 2]/attrib/name}.html"><img class="thumb" width="{following-sibling::object[position() = 2]/attrib/thumb-x-size}" height="{following-sibling::object[position() = 2]/attrib/thumb-y-size}" src="{following-sibling::object[position() = 2]/attrib/thumb-path}/{following-sibling::object[position() = 2]/attrib/thumb-name}" border="0" /></a>
</xsl:if>
</td>
</tr>
</xsl:template>
<!-- creates a vertical thumbnail slider. Must be in a table -->
<xsl:template name="gal-emit-vertical-thumb-slider">
<xsl:param name="html-file-prefix" />
<xsl:param name="thumb-size" />
<xsl:param name="parent-index" />
<xsl:param name="index-last" />
<tr>
<td align="center" width="{$thumb-size}" height="{$thumb-size}">
<xsl:if test="position() > 2 or $parent-index != 1">
<a href="{$html-file-prefix}{preceding-sibling::object[position() = 2]/attrib/name}.html"><img class="thumb" width="{preceding-sibling::object[position() = 2]/attrib/thumb-x-size}" height="{preceding-sibling::object[position() = 2]/attrib/thumb-y-size}" src="{preceding-sibling::object[position() = 2]/attrib/thumb-path}/{preceding-sibling::object[position() = 2]/attrib/thumb-name}" border="0" /></a>
</xsl:if>
</td>
</tr>
<tr>
<td align="center" width="{$thumb-size}" height="{$thumb-size}">
<xsl:if test="position() > 1 or $parent-index != 1">
<a href="{$html-file-prefix}{preceding-sibling::object[position() = 1]/attrib/name}.html"><img class="thumb" width="{preceding-sibling::object[position() = 1]/attrib/thumb-x-size}" height="{preceding-sibling::object[position() = 1]/attrib/thumb-y-size}" src="{preceding-sibling::object[position() = 1]/attrib/thumb-path}/{preceding-sibling::object[position() = 1]/attrib/thumb-name}" border="0" /></a>
</xsl:if>
</td>
</tr>
<tr>
<td align="center" width="{$thumb-size}" height="{$thumb-size}">
<img class="thumb" width="{attrib/thumb-x-size}" height="{attrib/thumb-y-size}" src="{attrib/thumb-path}/{attrib/thumb-name}" border="0" />
</td>
</tr>
<tr>
<td align="center" width="{$thumb-size}" height="{$thumb-size}">
<xsl:if test="position() < last() or $parent-index != $index-last">
<a href="{$html-file-prefix}{following-sibling::object[position() = 1]/attrib/name}.html"><img class="thumb" width="{following-sibling::object[position() = 1]/attrib/thumb-x-size}" height="{following-sibling::object[position() = 1]/attrib/thumb-y-size}" src="{following-sibling::object[position() = 1]/attrib/thumb-path}/{following-sibling::object[position() = 1]/attrib/thumb-name}" border="0" /></a>
</xsl:if>
</td>
</tr>
<tr>
<td align="center" width="{$thumb-size}" height="{$thumb-size}">
<xsl:if test="position() < last() - 1 or $parent-index != $index-last">
<a href="{$html-file-prefix}{following-sibling::object[position() = 2]/attrib/name}.html"><img class="thumb" width="{following-sibling::object[position() = 2]/attrib/thumb-x-size}" height="{following-sibling::object[position() = 2]/attrib/thumb-y-size}" src="{following-sibling::object[position() = 2]/attrib/thumb-path}/{following-sibling::object[position() = 2]/attrib/thumb-name}" border="0" /></a>
</xsl:if>
</td>
</tr>
</xsl:template>
<xsl:template name="gal-emit-exposure">
<xsl:variable name="exposure" select="attrib/exposure-time" />
<xsl:choose>
<!-- XXX there has to be a better way to figure out if something is undefined... -->
<xsl:when test="string(number($exposure)) = 'NaN' or $exposure = 0.0 or $exposure = ''" />
<xsl:when test="$exposure >= 1.0 or $exposure <= 0.0">
Exposure: <xsl:value-of select="$exposure" />"
</xsl:when>
<xsl:otherwise>
Exposure: 1/<xsl:value-of select="round(1.0 div $exposure)" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="gal-emit-f-stop">
<xsl:variable name="f-stop" select="attrib/f-stop" />
<xsl:choose>
<!-- XXX there has to be a better way to figure out if something is undefined... -->
<xsl:when test="string(number($f-stop)) = 'NaN' or $f-stop = 0.0 or $f-stop = ''" />
<xsl:otherwise>
F/Stop: <xsl:value-of select="$f-stop" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="gal-emit-focal-distance">
<xsl:variable name="focal-distance" select="attrib/focal-distance" />
<xsl:choose>
<!-- XXX there has to be a better way to figure out if something is undefined... -->
<xsl:when test="string(number($focal-distance)) = 'NaN' or $focal-distance = 0.0 or $focal-distance = ''" />
<xsl:otherwise>
Focal Distance: <xsl:value-of select="$focal-distance" />m
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="gal-emit-flash-used">
<xsl:variable name="used" select="attrib/flash-used" />
<xsl:choose>
<!-- XXX there has to be a better way to figure out if something is undefined... -->
<xsl:when test="string(number($used)) = 'NaN' or $used = ''" />
<xsl:when test="$used = 1">
Flash: Used
</xsl:when>
<xsl:otherwise>
Flash: Not used
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="gal-emit-is-color">
<xsl:variable name="color" select="attrib/is-color" />
<xsl:choose>
<xsl:when test="string(number($color)) = 'NaN'" />
<xsl:when test="$color = 1">
Mode: Color
</xsl:when>
<xsl:otherwise>
Mode: Black & White
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="gal-emit-ccd-width">
<xsl:variable name="ccd-width" select="attrib/ccd-width" />
<xsl:choose>
<!-- XXX there has to be a better way to figure out if something is undefined... -->
<xsl:when test="string(number($ccd-width)) = 'NaN' or $ccd-width = 0.0 or $ccd-width = ''" />
<xsl:when test="$ccd-width = 0.0 or $ccd-width = ''" />
<xsl:otherwise>
CCD Width: <xsl:value-of select="attrib/ccd-width" />mm
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="gal-emit-exif-version">
<xsl:variable name="exif-version" select="attrib/exif-version" />
<xsl:choose>
<!-- XXX there has to be a better way to figure out if something is undefined... -->
<xsl:when test="string(number($exif-version)) = 'NaN' or $exif-version = 0.0 or $exif-version = ''" />
<xsl:otherwise>
EXIF Version: <xsl:value-of select="$exif-version" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="gal-emit-name-value-string">
<xsl:param name="name" />
<xsl:param name="value" />
<xsl:choose>
<xsl:when test="string-length($value) = 0" />
<xsl:otherwise>
<xsl:value-of select="$name" /><xsl:value-of select="$value" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="gal-rplstr">
<xsl:param name="value" />
<xsl:param name="from" />
<xsl:param name="to" />
<xsl:choose>
<xsl:when test="contains($value, $from)">
<xsl:value-of select="substring-before($value, $from)" />
<xsl:value-of select="$to" />
<xsl:call-template name="gal-rplstr">
<xsl:with-param name="value" select="substring-after($value, $from)" />
<xsl:with-param name="from" select="$from" />
<xsl:with-param name="to" select="$to" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>